import { Col } from "antd";
import styles from "./index.module.less";
import cs from "classnames";

interface Props {
	label: string;
	spanNum?: number;
	className?: string;
	isRequired?: boolean;
}

export default (props: Props) => {
	const { label, spanNum = 4, className, isRequired } = props;

	return (
		<Col span={spanNum}>
			<label
				className={cs(
					{
						[styles.custom_label]: true,
						[styles.isRequired]: isRequired
					},
					className
				)}
			>
				<span>{label}</span>
			</label>
		</Col>
	);
};
